package com.changzhi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.changzhi.ldyl.model.OrderDay;
import com.changzhi.ldyl.model.PaymentOrder;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huangrc
 * @since 2020-11-26
 */
public interface OrderDayMapper extends BaseMapper<OrderDay> {

	//获取当天用户充值总金额
	OrderDay getTotalPrice(@Param("userId") String userId, @Param("createDate") LocalDate createDate);

	OrderDay getFirstPrice(@Param("userId") String userId);

	//获取为0的问题订单
	List<OrderDay> getPriceByZero(@Param("createDate") LocalDate createDate);

	//插入或更新到订单天表
	void replaceOrderDay(OrderDay orderDay);

	//获取当天按用户分组充值总金额
	List<OrderDay> getOrderDayList(@Param("startTime") String startTime, @Param("endTime") String endTime);

	//插入或更新到订单天表
	void replaceBatchOrderDay(@Param("records") List<OrderDay> records);

	//比较订单总金额是否相等
	Double compareOrderTotalPrice(@Param("createDate") LocalDate createDate, @Param("startTime") String startTime, @Param("endTime") String endTime);

	//比较订单总钻石是否相等
	Integer compareOrderTotalDiamonds(@Param("createDate") LocalDate createDate, @Param("startTime") String startTime, @Param("endTime") String endTime);

	//void insertIgnoreFirstOrder(FirstOrder firstOrder);

	List<PaymentOrder> getFirstOrderPriceList(@Param("createDate") LocalDate createDate);

	PaymentOrder getFirstOrderPrice(String userId);

	//获取用户充值总金额
	Double selectSumPrice(@Param("userId") String userId, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

	//void replaceIntoFirstOrder(FirstOrder record);
}
